﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;
using ExtAspNet;

namespace GPCSC.Web.SHFW
{
    public partial class CLpyEdit : PageBase
    {
        
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string ids = Usual.f_querystringToString("id");
                F_bound(ids);
            }

        }
        protected void F_bound(string ids)
        {
            DataSet ds = new CL_PY().CLF_boundById(ids);
            if (ds.Tables.Count > 0)
            {
                if (ds.Tables[0].Rows.Count > 0)
                {
                    username.Text = ds.Tables[0].Rows[0]["username"].ToString();
                    dwname.Text = ds.Tables[0].Rows[0]["dwname"].ToString();
                    phoneNum.Text = ds.Tables[0].Rows[0]["phoneNum"].ToString();
                    Email.Text = ds.Tables[0].Rows[0]["Email"].ToString();
                    YJcount.Text = ds.Tables[0].Rows[0]["YJcount"].ToString();
                    zt.Text = ds.Tables[0].Rows[0]["zt"].ToString();
                    tjdate.Text = ds.Tables[0].Rows[0]["tjdate"].ToString();
                    CLname.Text = ds.Tables[0].Rows[0]["CLname"].ToString();
                    CLcount.Text = ds.Tables[0].Rows[0]["CLcount"].ToString();
                }
            }
        }

        protected void btnRegister_Click(object sender, EventArgs e)
        {
            string ids = Usual.f_querystringToString("id");
            Hashtable htable = new Hashtable();
            htable.Add("CLname", this.CLname.Text);
            htable.Add("CLcount", this.CLcount.Text);
           // htable.Add("CLcount", this.CLcount.Text);
            GPCSC.Webs.databyhtable dh = new GPCSC.Webs.databyhtable();
            dh.databyhtables(htable, "update", "CL_PY", "pyid", ids);
            PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
        }
    }
}